package system.data;

/* @(#)system/base/C:\\Documents and Settings\\Administrator\\����\\APEP3\\JavaSourceOutput\ProviderTypeBase.java    V1.0
 *
 * Project: APEP 
 *
 * Modify Information:
 * =============================================================================
 *   Author       Date       Description
 *   ------------ ---------- ---------------------------------------------------
 *       {CREATE_TIME} First release
 *
 * Copyright Notice:
 * =============================================================================
 *    Copyright (c) 2001-2007 Auto-Parts E-Procurement Co., Ltd. 
 *        No.251-1 Wuning Road, Shanghai, 200063, China All rights reserved.
 *
 *    This software is the confidential and proprietary information of
 *        Auto-Parts E-Procurement Co., Ltd. ("Confidential Information").
 *        You shall not disclose such Confidential Information and shall use it
 *        only in accordance with the terms of the license agreement you entered
 *        into with APEP.
 *
 * Warning:
 * =============================================================================
 *   
 * 
 */


import java.util.*;

import framework.core.*;
/*
	Author    :
	CreateTime:{CREATE_TIME}
*/
public class ProviderTypeBase extends Table 
{
public static final String TABLE_NAME = "T_PROVIDER_TYPE";

private static final String BACKUP_TABLE_NAME = "T_PROVIDER_TYPE_BACKUP";

private static final String BACKUP_SEQ_NAME = "S_PROVIDER_TYPE_BACKUP";


public static final String ID = "ID";

public static final String PROVIDER_ID = "PROVIDER_ID";

public static final String PROVIDER_CODE = "PROVIDER_CODE";

public static final String PROVIDER_TYPE = "PROVIDER_TYPE";

public static final String REMARK = "REMARK";

public static final String CREATE_TIME = "CREATE_TIME";

public static final String CREATE_USER = "CREATE_USER";

public static final String CREATE_USER_ID = "CREATE_USER_ID";

public static final String LAST_UPDATE_TIME = "LAST_UPDATE_TIME";

public static final String LAST_UPDATE_USER = "LAST_UPDATE_USER";

public static final String LAST_UPDATE_USER_ID = "LAST_UPDATE_USER_ID";


public static Vector m_fields = null;


private String m_ID = ""; //ID

private String m_PROVIDER_ID = ""; //PROVIDER_ID

private String m_PROVIDER_CODE = ""; //PROVIDER_CODE

private int m_PROVIDER_TYPE = Value.NULL_INT;  //PROVIDER_TYPE

private String m_REMARK = ""; //REMARK

private String m_CREATE_TIME = ""; //CREATE_TIME

private String m_CREATE_USER = ""; //CREATE_USER

private String m_CREATE_USER_ID = ""; //CREATE_USER_ID

private String m_LAST_UPDATE_TIME = ""; //LAST_UPDATE_TIME

private String m_LAST_UPDATE_USER = ""; //LAST_UPDATE_USER

private String m_LAST_UPDATE_USER_ID = ""; //LAST_UPDATE_USER_ID



	public String getId()
	{
	    return m_ID;
	}
	public void  setId(String v)
	{
		if(getId().equals(v)) return ;
		m_ID = v ;
		markDirty(ID);
	}

	public String getProviderId()
	{
	    return m_PROVIDER_ID;
	}
	public void  setProviderId(String v)
	{
		if(getProviderId().equals(v)) return ;
		m_PROVIDER_ID = v ;
		markDirty(PROVIDER_ID);
	}

	public String getProviderCode()
	{
	    return m_PROVIDER_CODE;
	}
	public void  setProviderCode(String v)
	{
		if(getProviderCode().equals(v)) return ;
		m_PROVIDER_CODE = v ;
		markDirty(PROVIDER_CODE);
	}

	public int getProviderType()
	{
	    return m_PROVIDER_TYPE;
	}
	public void  setProviderType(int v)
	{
		if(getProviderType()==v) return ;
		m_PROVIDER_TYPE = v ;
		markDirty(PROVIDER_TYPE);
	}

	public String getRemark()
	{
	    return m_REMARK;
	}
	public void  setRemark(String v)
	{
		if(getRemark().equals(v)) return ;
		m_REMARK = v ;
		markDirty(REMARK);
	}

	public String getCreateTime()
	{
	    return m_CREATE_TIME;
	}
	public void  setCreateTime(String v)
	{
		if(getCreateTime().equals(v)) return ;
		m_CREATE_TIME = v ;
		markDirty(CREATE_TIME);
	}

	public String getCreateUser()
	{
	    return m_CREATE_USER;
	}
	public void  setCreateUser(String v)
	{
		if(getCreateUser().equals(v)) return ;
		m_CREATE_USER = v ;
		markDirty(CREATE_USER);
	}

	public String getCreateUserId()
	{
	    return m_CREATE_USER_ID;
	}
	public void  setCreateUserId(String v)
	{
		if(getCreateUserId().equals(v)) return ;
		m_CREATE_USER_ID = v ;
		markDirty(CREATE_USER_ID);
	}

	public String getLastUpdateTime()
	{
	    return m_LAST_UPDATE_TIME;
	}
	public void  setLastUpdateTime(String v)
	{
		if(getLastUpdateTime().equals(v)) return ;
		m_LAST_UPDATE_TIME = v ;
		markDirty(LAST_UPDATE_TIME);
	}

	public String getLastUpdateUser()
	{
	    return m_LAST_UPDATE_USER;
	}
	public void  setLastUpdateUser(String v)
	{
		if(getLastUpdateUser().equals(v)) return ;
		m_LAST_UPDATE_USER = v ;
		markDirty(LAST_UPDATE_USER);
	}

	public String getLastUpdateUserId()
	{
	    return m_LAST_UPDATE_USER_ID;
	}
	public void  setLastUpdateUserId(String v)
	{
		if(getLastUpdateUserId().equals(v)) return ;
		m_LAST_UPDATE_USER_ID = v ;
		markDirty(LAST_UPDATE_USER_ID);
	}



	public String viewId(DBConnection con) throws Exception
	{
		return Value.view(getId());
	}

	public String viewProviderId(DBConnection con) throws Exception
	{
		return Value.view(getProviderId());
	}

	public String viewProviderCode(DBConnection con) throws Exception
	{
		return Value.view(getProviderCode());
	}

	public String viewProviderType(DBConnection con) throws Exception
	{
		return Value.view(getProviderType());
	}

	public String viewRemark(DBConnection con) throws Exception
	{
		return Value.view(getRemark());
	}

	public String viewCreateTime(DBConnection con) throws Exception
	{
		return Value.view(getCreateTime());
	}

	public String viewCreateUser(DBConnection con) throws Exception
	{
		return Value.view(getCreateUser());
	}

	public String viewCreateUserId(DBConnection con) throws Exception
	{
		return Value.view(getCreateUserId());
	}

	public String viewLastUpdateTime(DBConnection con) throws Exception
	{
		return Value.view(getLastUpdateTime());
	}

	public String viewLastUpdateUser(DBConnection con) throws Exception
	{
		return Value.view(getLastUpdateUser());
	}

	public String viewLastUpdateUserId(DBConnection con) throws Exception
	{
		return Value.view(getLastUpdateUserId());
	}



protected ProviderTypeBase()
{
}

public void fill(ProviderTypePageData pageData) throws Exception
{

	if(pageData.getId()!=null)
	{	
		setId(pageData.getId());
	}

	if(pageData.getProviderId()!=null)
	{	
		setProviderId(pageData.getProviderId());
	}

	if(pageData.getProviderCode()!=null)
	{	
		setProviderCode(pageData.getProviderCode());
	}

	if( pageData.getProviderType()!=null && 
	   !pageData.getProviderType().equals(""))
	{	
		setProviderType(Integer.parseInt(pageData.getProviderType()));
	}

	if(pageData.getRemark()!=null)
	{	
		setRemark(pageData.getRemark());
	}

	if(pageData.getCreateTime()!=null)
	{	
		setCreateTime(pageData.getCreateTime());
	}

	if(pageData.getCreateUser()!=null)
	{	
		setCreateUser(pageData.getCreateUser());
	}

	if(pageData.getCreateUserId()!=null)
	{	
		setCreateUserId(pageData.getCreateUserId());
	}

	if(pageData.getLastUpdateTime()!=null)
	{	
		setLastUpdateTime(pageData.getLastUpdateTime());
	}

	if(pageData.getLastUpdateUser()!=null)
	{	
		setLastUpdateUser(pageData.getLastUpdateUser());
	}

	if(pageData.getLastUpdateUserId()!=null)
	{	
		setLastUpdateUserId(pageData.getLastUpdateUserId());
	}

}

public String getTableName() 
{
	return TABLE_NAME;
}

public String getBackupTableName() 
{
	return BACKUP_TABLE_NAME;
}

public String getBackupSeqName() 
{
	return BACKUP_SEQ_NAME;
}

public java.util.Vector getFields() 
{
	if(m_fields==null)
	{
		m_fields = new Vector();

		m_fields.add(new Field(ID,Value.TYPE_STRING,true,true,32,"ID"));

		m_fields.add(new Field(PROVIDER_ID,Value.TYPE_STRING,false,true,32,"PROVIDER_ID"));

		m_fields.add(new Field(PROVIDER_CODE,Value.TYPE_STRING,false,true,10,"PROVIDER_CODE"));

		m_fields.add(new Field(PROVIDER_TYPE,Value.TYPE_INT,false,true,0,"PROVIDER_TYPE"));

		m_fields.add(new Field(REMARK,Value.TYPE_STRING,false,true,50,"REMARK"));

		m_fields.add(new Field(CREATE_TIME,Value.TYPE_STRING,false,true,32,"CREATE_TIME"));

		m_fields.add(new Field(CREATE_USER,Value.TYPE_STRING,false,true,32,"CREATE_USER"));

		m_fields.add(new Field(CREATE_USER_ID,Value.TYPE_STRING,false,true,32,"CREATE_USER_ID"));

		m_fields.add(new Field(LAST_UPDATE_TIME,Value.TYPE_STRING,false,true,32,"LAST_UPDATE_TIME"));

		m_fields.add(new Field(LAST_UPDATE_USER,Value.TYPE_STRING,false,true,32,"LAST_UPDATE_USER"));

		m_fields.add(new Field(LAST_UPDATE_USER_ID,Value.TYPE_STRING,false,true,32,"LAST_UPDATE_USER_ID"));
	

	}
	return m_fields;
}

public void initObject(java.sql.ResultSet rs) throws Exception
{

	m_ID = getString(rs,ID);

	m_PROVIDER_ID = getString(rs,PROVIDER_ID);

	m_PROVIDER_CODE = getString(rs,PROVIDER_CODE);

	m_PROVIDER_TYPE = getInt(rs,PROVIDER_TYPE);

	m_REMARK = getString(rs,REMARK);

	m_CREATE_TIME = getString(rs,CREATE_TIME);

	m_CREATE_USER = getString(rs,CREATE_USER);

	m_CREATE_USER_ID = getString(rs,CREATE_USER_ID);

	m_LAST_UPDATE_TIME = getString(rs,LAST_UPDATE_TIME);

	m_LAST_UPDATE_USER = getString(rs,LAST_UPDATE_USER);

	m_LAST_UPDATE_USER_ID = getString(rs,LAST_UPDATE_USER_ID);

	ms_new_flag = ConstDefine.NO;
}

public Value get(String f)
{

	if(f.equalsIgnoreCase(ID))
	{
		return new Value(getId());
	}

	if(f.equalsIgnoreCase(PROVIDER_ID))
	{
		return new Value(getProviderId());
	}

	if(f.equalsIgnoreCase(PROVIDER_CODE))
	{
		return new Value(getProviderCode());
	}

	if(f.equalsIgnoreCase(PROVIDER_TYPE))
	{
		return new Value(getProviderType());
	}

	if(f.equalsIgnoreCase(REMARK))
	{
		return new Value(getRemark());
	}

	if(f.equalsIgnoreCase(CREATE_TIME))
	{
		return new Value(getCreateTime());
	}

	if(f.equalsIgnoreCase(CREATE_USER))
	{
		return new Value(getCreateUser());
	}

	if(f.equalsIgnoreCase(CREATE_USER_ID))
	{
		return new Value(getCreateUserId());
	}

	if(f.equalsIgnoreCase(LAST_UPDATE_TIME))
	{
		return new Value(getLastUpdateTime());
	}

	if(f.equalsIgnoreCase(LAST_UPDATE_USER))
	{
		return new Value(getLastUpdateUser());
	}

	if(f.equalsIgnoreCase(LAST_UPDATE_USER_ID))
	{
		return new Value(getLastUpdateUserId());
	}
	
	return null;
}
public void set(String f,Value v) throws Exception
{

	if(f.equalsIgnoreCase(ID))
	{
		setId(v.getString());
	}

	if(f.equalsIgnoreCase(PROVIDER_ID))
	{
		setProviderId(v.getString());
	}

	if(f.equalsIgnoreCase(PROVIDER_CODE))
	{
		setProviderCode(v.getString());
	}

	if(f.equalsIgnoreCase(PROVIDER_TYPE))
	{
		setProviderType(v.getInt());
	}

	if(f.equalsIgnoreCase(REMARK))
	{
		setRemark(v.getString());
	}

	if(f.equalsIgnoreCase(CREATE_TIME))
	{
		setCreateTime(v.getString());
	}

	if(f.equalsIgnoreCase(CREATE_USER))
	{
		setCreateUser(v.getString());
	}

	if(f.equalsIgnoreCase(CREATE_USER_ID))
	{
		setCreateUserId(v.getString());
	}

	if(f.equalsIgnoreCase(LAST_UPDATE_TIME))
	{
		setLastUpdateTime(v.getString());
	}

	if(f.equalsIgnoreCase(LAST_UPDATE_USER))
	{
		setLastUpdateUser(v.getString());
	}

	if(f.equalsIgnoreCase(LAST_UPDATE_USER_ID))
	{
		setLastUpdateUserId(v.getString());
	}
	
}
public String toString()
{
	String msg = "ProviderType=\n";
	msg += "(\r\n";

	msg += "    ID(ID)="+get("ID")+"\r\n";

	msg += "    PROVIDER_ID(PROVIDER_ID)="+get("PROVIDER_ID")+"\r\n";

	msg += "    PROVIDER_CODE(PROVIDER_CODE)="+get("PROVIDER_CODE")+"\r\n";

	msg += "    PROVIDER_TYPE(PROVIDER_TYPE)="+get("PROVIDER_TYPE")+"\r\n";

	msg += "    REMARK(REMARK)="+get("REMARK")+"\r\n";

	msg += "    CREATE_TIME(CREATE_TIME)="+get("CREATE_TIME")+"\r\n";

	msg += "    CREATE_USER(CREATE_USER)="+get("CREATE_USER")+"\r\n";

	msg += "    CREATE_USER_ID(CREATE_USER_ID)="+get("CREATE_USER_ID")+"\r\n";

	msg += "    LAST_UPDATE_TIME(LAST_UPDATE_TIME)="+get("LAST_UPDATE_TIME")+"\r\n";

	msg += "    LAST_UPDATE_USER(LAST_UPDATE_USER)="+get("LAST_UPDATE_USER")+"\r\n";

	msg += "    LAST_UPDATE_USER_ID(LAST_UPDATE_USER_ID)="+get("LAST_UPDATE_USER_ID")+"\r\n";
		
	msg += ")\r\n";
	return msg;
}
public void copyBase(ProviderTypeBase srcObj)
{

	setProviderId(srcObj.getProviderId());

	setProviderCode(srcObj.getProviderCode());

	setProviderType(srcObj.getProviderType());

	setRemark(srcObj.getRemark());

	setCreateTime(srcObj.getCreateTime());

	setCreateUser(srcObj.getCreateUser());

	setCreateUserId(srcObj.getCreateUserId());

	setLastUpdateTime(srcObj.getLastUpdateTime());

	setLastUpdateUser(srcObj.getLastUpdateUser());

	setLastUpdateUserId(srcObj.getLastUpdateUserId());

}

public String toXml() throws Exception
{
	String xml = "";
	xml += "<ProviderType>";

	xml += "<Id>"+Value.view(getId())+"</Id>";

	xml += "<ProviderId>"+Value.view(getProviderId())+"</ProviderId>";

	xml += "<ProviderCode>"+Value.view(getProviderCode())+"</ProviderCode>";

	xml += "<ProviderType>"+Value.view(getProviderType())+"</ProviderType>";

	xml += "<Remark>"+Value.view(getRemark())+"</Remark>";

	xml += "<CreateTime>"+Value.view(getCreateTime())+"</CreateTime>";

	xml += "<CreateUser>"+Value.view(getCreateUser())+"</CreateUser>";

	xml += "<CreateUserId>"+Value.view(getCreateUserId())+"</CreateUserId>";

	xml += "<LastUpdateTime>"+Value.view(getLastUpdateTime())+"</LastUpdateTime>";

	xml += "<LastUpdateUser>"+Value.view(getLastUpdateUser())+"</LastUpdateUser>";

	xml += "<LastUpdateUserId>"+Value.view(getLastUpdateUserId())+"</LastUpdateUserId>";
	
	xml += "</ProviderType>";
	return xml;
}

}
